/*
 * CItemType.java
 *
 * Copyright (c) 2009 Giles Millward (Manigra). All rights reserved.
 *
 * This file is part of JRogueDPS.
 *
 * JRogueDPS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * JRogueDPS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with JRogueDPS.  If not, see <http://www.gnu.org/licenses/>.
 */

package geardatabase;

/**
 *
 * @author gmillward
 */
public class CItemType {
    public enum ItemType {
            LEATHER, DAGGER, FIST, MACE, SWORD, BOW, CROSSBOW, THROWN, GUN, GEM, TRINKET, RING,
            AMULET, CLOAK, ENCHANT, POISON, AXE,
            UNKNOWN
            };

    static public String getItemTypeName(ItemType p_itemType)
    {
        if (p_itemType == ItemType.LEATHER)
        {
            return "Leather";
        } else if (p_itemType == ItemType.DAGGER)
        {
            return "Dagger";
        } else if (p_itemType == ItemType.FIST)
        {
            return "Fist";
        } else if (p_itemType == ItemType.MACE)
        {
            return "Mace";
        } else if (p_itemType == ItemType.AXE)
        {
            return "Axe";
        } else if (p_itemType == ItemType.SWORD)
        {
            return "Sword";
        } else if (p_itemType == ItemType.BOW)
        {
            return "Bow";
        } else if (p_itemType == ItemType.CROSSBOW)
        {
            return "Crossbow";
        } else if (p_itemType == ItemType.THROWN)
        {
            return "Thrown";
        } else if (p_itemType == ItemType.GUN)
        {
            return "Gun";
        } else if (p_itemType == ItemType.GEM)
        {
            return "Gem";
        } else if (p_itemType == ItemType.TRINKET)
        {
            return "Trinket";
        } else if (p_itemType == ItemType.RING)
        {
            return "Ring";
        } else if (p_itemType == ItemType.AMULET)
        {
            return "Amulate";
        }else if (p_itemType == ItemType.CLOAK)
        {
            return "Cloak";
        }else if (p_itemType == ItemType.POISON)
        {
            return "Poison";
        }else if (p_itemType == ItemType.ENCHANT)
        {
            return "Enchant";
        }

        return "Unknown";
    }

    static public ItemType getItemType(String p_itemName)
    {
        if (p_itemName.toLowerCase().equals("leather"))
        {
            return ItemType.LEATHER;
        } else if (p_itemName.toLowerCase().equals("dagger"))
        {
            return ItemType.DAGGER;
        } else if (p_itemName.toLowerCase().equals("axe"))
        {
            return ItemType.AXE;
        } else if (p_itemName.toLowerCase().equals("fist"))
        {
            return ItemType.FIST;
        } else if (p_itemName.toLowerCase().equals("mace"))
        {
            return ItemType.MACE;
        } else if (p_itemName.toLowerCase().equals("sword"))
        {
            return ItemType.SWORD;
        } else if (p_itemName.toLowerCase().equals("bow"))
        {
            return ItemType.BOW;
        } else if (p_itemName.toLowerCase().equals("crossbow"))
        {
            return ItemType.CROSSBOW;
        } else if (p_itemName.toLowerCase().equals("thrown"))
        {
            return ItemType.THROWN;
        } else if (p_itemName.toLowerCase().equals("gun"))
        {
            return ItemType.GUN;
        } else if (p_itemName.toLowerCase().equals("gem"))
        {
            return ItemType.GEM;
        } else if (p_itemName.toLowerCase().equals("trinket"))
        {
            return ItemType.TRINKET;
        } else if (p_itemName.toLowerCase().equals("ring"))
        {
            return ItemType.RING;
        } else if (p_itemName.toLowerCase().equals("amulet"))
        {
            return ItemType.AMULET;
        } else if (p_itemName.toLowerCase().equals("cloak"))
        {
            return ItemType.CLOAK;
        } else if (p_itemName.toLowerCase().equals("poison"))
        {
            return ItemType.POISON;
        } else if (p_itemName.toLowerCase().equals("enchant"))
        {
            return ItemType.ENCHANT;
        }

        return ItemType.UNKNOWN;
    }
}
